package com.mybook.app.exception;

import com.mybook.app.error.Error;

/**
 * 数据校验异常
 */
public class VailDataException extends WebException {
    private static final long serialVersionUID = -6664597933525995502L;

    private Error error;

    private String message = "";

    public VailDataException(Error error, String message) {
        this.error = error;
        this.message = message;
    }

    @Override
    public Error getCode() {
        return this.error;
    }

    @Override
    public String getErrorMessage() {
        return String.format(getCode().getMessage(), message);
    }

}
